﻿@addTagHelper *, WebVella.Erp.Plugins.Core
@addTagHelper *, WebVella.Erp.Web
@addTagHelper *, WebVella.TagHelpers
@using WebVella.Erp.Web.Utils;
@using WebVella.Erp.Api.Models;
@using WebVella.Erp.Web.Models;
@using WebVella.Erp.Plugins.Project.Components;
@using WebVella.TagHelpers.Models;
@{
	var options = (PcProjectWidgetTasksPriorityChart.PcProjectWidgetTasksPriorityChartOptions)ViewBag.Options;
	var datasets = (List<WvChartDataset>)ViewBag.Datasets;
	var lowPriority = (int)ViewBag.LowPriority;
	var normalPriority = (int)ViewBag.NormalPriority;
	var highPriority = (int)ViewBag.HighPriority;
	var priorityOptions = (List<SelectOption>)ViewBag.PriorityOptions;
	var lowPriorityOption = priorityOptions.First(x => x.Value == "1");
	var normalPriorityOption = priorityOptions.First(x => x.Value == "2");
	var highPriorityOption = priorityOptions.First(x => x.Value == "3");
}
<wv-row flex-vertical-alignment="Center" class="w-100 h-100" no-gutters="true">
	<wv-column class="flex-grow-0">
		<wv-chart type="Doughnut" datasets="@datasets" width="100px" height="100px"></wv-chart>		
	</wv-column>
	<wv-column class="flex-grow-1 pl-4">
		<wv-row class="mb-2">
			<wv-column>
				<div>High</div>
				@if (highPriority > 0)
				{
					<div><strong><i class="@highPriorityOption.IconClass" style="color: @highPriorityOption.Color"></i> @highPriority</strong></div>	
				}
				else { 
					<div class="go-gray">0</div>
				}
			</wv-column>
			<wv-column>
				<div>Normal</div>
				@if (normalPriority > 0)
				{
					<div><strong><i class="@normalPriorityOption.IconClass" style="color: @normalPriorityOption.Color"></i> @normalPriority</strong></div>		
				}
				else { 
					<div class="go-gray">0</div>
				}
			</wv-column>
		</wv-row>
		<wv-row class="mb-2">
			<wv-column>
				<div>Low</div>
				@if (lowPriority > 0)
				{
				<div><strong><i class="@lowPriorityOption.IconClass" style="color: @lowPriorityOption.Color"></i> @lowPriority</strong></div>			
				}
				else { 
					<div class="go-gray">0</div>
				}
			</wv-column>
			<wv-column>
			</wv-column>
		</wv-row>		
	</wv-column>
</wv-row>